
<template>
  <a-layout id="components-layout-demo-fixed-sider">
    <a-layout-sider
      :style="{ overflow: 'auto', height: '100vh', position: 'fixed', left: 0 }"
      class="aside"
    >
      <div class="logo">
        <span>春播后台管理系统</span>
      </div>
      <a-menu theme="dark" mode="inline" :default-selected-keys="['4']">
        <a-menu-item :key="i" v-for="(item, i) in HomeChild">
          <router-link :to="item.path">
            <span class="nav-text">{{ item.til }}</span></router-link
          >
        </a-menu-item>
      </a-menu>
    </a-layout-sider>
    <a-layout :style="{ marginLeft: '200px' }">
      <router-view></router-view>
    </a-layout>
    <el-button @click="logout" class="tuichu" type="info">退出</el-button>
  </a-layout>
</template>
<script>
import HomeChild from "../router/home";
export default {
  data() {
    return {
      HomeChild,
    };
  },
  methods: {
    logout() {
      window.sessionStorage.clear();
      this.$router.push("/login");
    },
  },
};
</script>
<style lang="scss">
#components-layout-demo-fixed-sider .logo {
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  margin: 16px;
  .logo {
    text-align: center;
  }
}
.tuichu {
  position: absolute;
  top: 10px;
  right: 50px;
}
.logo span{
  line-height: 35px;
  color: #fff;
}
</style>
